<%@ page session="true" %>
<%@ page pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<TITLE>管理员控制台登录</TITLE>
<link href="static/mycss/style.css" rel="stylesheet" type="text/css" />
<link href="static/mycss/passport.css" rel="stylesheet" type="text/css" />
<link href="static/mycss/dntmanager.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
    var init = function(){
        if(${not empty userName }){
            document.getElementById('username').value = '${userName}';
        }
        if(${not empty confirm}){
            if(document.getElementById("status") == null){
                document.getElementById("captcha").className="errors"; 
                document.getElementById("captcha").innerHTML ="验证码输入错误!";
            }
        }
    }
    
    var clear = function(){
        document.getElementById('username').value = '';
        document.getElementById('password').value = '';
    }
</script>
</head>
<body onload="init()" >
    <form method="post" id="fm1" action="/login" cssClass="fm-v clearfix" htmlEscape="true">
    <DIV id=LoginBar>
          <div class=FormNav>
          <table>
            <tr>
                <td colspan="3" height="50" align="center">
                    <span><font color="red">${error_message }</font></span>
                </td>
            </tr>
            <tr><td class="bottom"><LABEL>用户名:</LABEL><INPUT type="text"  id='username' name="userName"></td></tr>
            <tr><td class="bottom"><LABEL>密　码:</LABEL><INPUT type="password" id='password' name="password"></td></tr>
            
            <%
            	Integer count = (Integer)session.getAttribute("admin_login_error_count");
            	if(count != null && count >= 3){
            %>
            <tr>
	            <td>
	                <LABEL>验证码:</LABEL>
	                <input name = "j_captcha_response" maxlength="5" type="text" class="test" />
	                <img id="captcha" src="/kaptcha.jpg" width="100px" height="25px" onclick="this.src='/kaptcha.jpg?update=' + Math.random()">
            	</td>
            </tr>
            <%
            	}
            %>
            <tr><td class="loginbtn">
                <input type="image" src="static/myimages/button.gif" />
                <a href="javascript:clear()"><img src="static/myimages/button2.gif" onclick="javascript:clear()"/></a>
            </td></tr>
            </table>
        </div>
    </DIV>
  </form>

 <div class="botdiv" style="color:red;"><h1>本应用目前仅支持IE6,IE7,IE8,IE9,IE10,Firefox浏览器!</h1></div>

</body>
</html>
